const { merge } = require('webpack-merge')
const config = require('./webpack.common')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')

module.exports = merge(config, {
  mode: 'production',
  plugins: [
    new CleanWebpackPlugin(),
    new MiniCssExtractPlugin({
      filename: `assets/[name].[chunkHash:6].css`
    }),
    // new CopyWebpackPlugin({ patterns: [ 'public' ]})
  ]
})